<template>
	<zh-col v-if="rowFlag" :span="span" :md="md" :sm="sm" :xs="xs" :lg="lg" :xl="xl" :offset="offset" :push="push" :pull="pull" :tag="tag">
		<el-form-item style="width: 100%" :ref="prop" :label="label" :prop="prop">
			<slot />
		</el-form-item>
	</zh-col>
	<el-form-item v-else style="width: 100%" :ref="prop" :label="label" :prop="prop">
		<slot />
	</el-form-item>
</template>
<script lang="ts" setup>
import { formItemProps } from '../lib/mapController';
// 定义属性
defineProps({
	...formItemProps,
	rowFlag: {
		type: Boolean,
		default: true,
	},
});
</script>
<script lang="ts">
// 声明额外的选项
export default {
	name: 'zh-form-item',
	inheritallAttrs: false,
};
</script>
<style lang="scss" scoped>
.el-form--inline .el-form-item {
	margin-bottom: 18px !important;
}
:deep(.el-form-item--default .el-form-item__error) {
	position: absolute;
	top: 100%;
	left: 0;
	margin-left: 0;
}
:deep(.el-form-item--small .el-form-item__error) {
	position: absolute;
	top: 100%;
	left: 0;
	margin-left: 0;
}
:deep(.el-form-item--large .el-form-item__error) {
	position: absolute;
	top: 100%;
	left: 0;
	margin-left: 0;
}
</style>
